﻿using System.Text.RegularExpressions;
using System.Windows.Forms;

namespace Group_Mail
{
    public static class Utils
    {
        private const string EmailPattern = @"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*";

        public static string GetStartupPath()
        {
            return Application.StartupPath;
            //return @"D:\Group Mail";
        }

        public static bool IsValidEmail(string email)
        {
            return !string.IsNullOrEmpty(email) && new Regex(EmailPattern).IsMatch(email);
        }
    }
}